import axios from 'axios';
const url = '/api';
const myHttp = {
    mypost(path, data,token) {
        return new Promise((resolve, reject) => {
            axios.post(url + path, data, {
                    headers: {
                        'Content-Type': token
                    }
                })
                .then(function (response) {
                    resolve(response.data);
                })
                .catch(function (error) {
                    reject(error);
                });
        })
    },
    myVideoPost(data){
        return new Promise((resolve, reject) => {
            axios.post(url + '/changeText', data, {
                headers: {
                    "Content-Type":  "application/json;charset=utf-8"
                    // "application/x-www-form-urlencoded; charset=utf-8;",
                    // "X-Appid": 'x_appid',
                    // "X-Param": data
                }
            })
            .then(function (response) {
                resolve(response.data);
            })
            .catch(function (error) {
                reject(error);
            });
        })
    }
}

export default myHttp;